<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>新增店员</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" href="../../../../bangnuo/admin/layui/css/layui.css" media="all">
</head>

<body>

<div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin" style="padding: 20px 0 0 0;">
	<div class="layui-form-item">
		<label class="layui-form-label">登录名</label>
		<div class="layui-input-inline">
			<input type="text" name="assistantUsername" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
			<br />
			<!--<div class="layui-form-mid layui-word-red" style="color: red;">密码默认为：a88888</div>-->
		</div>
	</div>

	<div class="layui-form-item">
		<label class="layui-form-label">登录密码</label>
		<div class="layui-input-inline">
			<input type="text" name="assistantPassword" lay-verify="required" placeholder="请输入登录密码" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">真实姓名</label>
		<div class="layui-input-inline">
			<input type="text" name="assistantName" lay-verify="required" placeholder="请输入真实姓名" autocomplete="off" class="layui-input">
		</div>
	</div>

	<div class="layui-form-item">
		<label class="layui-form-label">手机号码</label>
		<div class="layui-input-inline">
			<input type="text" name="assistantPhone" lay-verify="phone" placeholder="请输入号码" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">邮箱</label>
		<div class="layui-input-inline">
			<input type="text" name="assistantEmail" lay-verify="email" placeholder="请输入邮箱" autocomplete="off" class="layui-input">
		</div>
	</div>
    <div class="layui-form-item" lay-filter="sex">
        <label class="layui-form-label">选择性别</label>
        <div class="layui-input-block">
            <input type="radio" name="assistantSex" value="男" title="男" checked>
            <input type="radio" name="assistantSex" value="女" title="女">
        </div>
    </div>
	<div class="layui-form-item" lay-filter="sex">
		<label class="layui-form-label">所属门店</label>
		<div class="layui-input-block" style="width: 200px;">
			<select name="terminalAgentId" id="terminalAgentId">
			</select>
		</div>
	</div>
	<div class="layui-btn-container" style="padding-bottom: 10px; margin-left: 110px; margin-right: -110px;">
		<button class="layui-btn" lay-submit lay-filter="admin-form" data-type="close">立即提交</button>
	</div>
</div>
<script src="../../../../bangnuo/admin/layui/layui.js"></script>
<script type="text/javascript" src="../../../../bangnuo/admin/js/jquery-1.8.0.min.js"></script>
<!--<script>
    layui.use(['form', 'upload', 'layer'], function() {

        var form = layui.form;

        var resultData;
        var htmls = '<option value="">请选择</option>'; //全局变量
        //检查项目添加到下拉框中
        $.ajax({
            url: '/table/users/',
            dataType: 'json',
            type: 'get',
            success: function(data) {
                resultData = data.queryResult.list;
                for(var x in resultData) {
                    htmls += '<option value = "' + resultData[x].id + '">' + resultData[x].name + '</option>';
                }
                $("#adminIdAgentId").html(htmls);
                form.render('select');
                //重新渲染 固定写法
            }
        })
    });
</script>-->
<!--加载表单组件样式-->
<script>
    layui.use(['form', 'upload', 'layer'], function () {
        var form = layui.form;

        var resultData;
        var htmls = '<option value="">请选择</option>'; //全局变量

        //检查项目添加到下拉框中
        $.ajax({
            url: '/terminalEntity/name',
            dataType: 'json',
            type: 'get',
            success: function(data) {
                resultData = data.queryResult.list;
                for(var x in resultData) {
                    htmls += '<option value = "' + resultData[x].id + '">' + resultData[x].name + '</option>';
                }
                $("#terminalAgentId").html(htmls);
                form.render('select');
                //重新渲染 固定写法
            }
        })

    });
</script>
<script>
    layui.config({
        base: '../../../../bangnuo/admin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'upload'], function() {
        var $ = layui.$,
            form = layui.form,
            upload = layui.upload;

        upload.render({
            elem: '#layuiadmin-upload-useradmin',
            url: layui.setter.base + 'json/upload/demo.js',
            accept: 'images',
            method: 'get',
            contentType : "application/json",
            acceptMime: 'image/*',
            done: function(res) {
                $(this.item).prev("div").children("input").val(res.data.src)
            }
        });
    })
</script>
<!--获取表单信息，提交表单-->
<script type="text/javascript">
    layui.use('form', function() {
        var form = layui.form;
        //监听提交
        form.on('submit(admin-form)', function(data) {
            $.ajax({
                type: "post",
                url: "/assistantEntity/addAssistant",
                contentType : "application/json",
                dataType: 'json',
                data: JSON.stringify(data.field),
                async: true,
                success: function(data) {
                    if(data.success == true) {
                        layer.msg(data.message);
                    } else {
                        layer.msg(data.message);
                    }
                }
            });
            return false;
        });
    });
</script>
<!--关闭弹层-->
<!--关闭弹层-->
<script>
    layui.use('layer', function() {
        var $ = layui.$,
            layer = layui.layer,
            index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        var active = {
            close: function() {
                var id = '#LAY_layer_iframe_demo',
                    mark = $('#LAY_mark');
                parent.layer.msg('添加成功');
                parent.layer.tips('Look here', id, {
                    time: 5000
                });
                parent.layer.close(index);
            }
        }
        $('.layui-btn-container .layui-btn').on('click', function() {
            var othis = $(this),
                type = othis.data('type');
            active[type] && active[type].call(this);
        });
    });
</script>
<!--
<script>
    layui.use('layer', function() {
        var $ = layui.$,
            layer = layui.layer,
            index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        var active = {
            close: function() {
                var id = '#LAY_layer_iframe_demo',
                    mark = $('#LAY_mark');
                parent.layer.msg('添加成功');
                parent.layer.tips('Look here', id, {
                    time: 5000
                });
                parent.layer.close(index);
            }
        }
        $('.layui-btn-container .layui-btn').on('click', function() {
            var othis = $(this),
                type = othis.data('type');
            active[type] && active[type].call(this);
        });
    });
</script>-->
</body>

</html>